include('shared.lua')

-- Sort out kill icons and the language name --
language.Add("sent_panel", "Robotic Panel")
killicon.Add("sent_panel", "vgui/entities/panel_killicon", Color(255, 80, 0, 255))

----------
-- Draw --
----------

function ENT:Draw()

  self:DrawModel()
  
  local drawBeam = self:GetNetworkedBool("drawBeam")
  if(drawBeam) then
    
    local color = self:GetNetworkedVector("color")
    local targ = self:GetNetworkedEntity("targ")
    if(!targ:IsValid()) then
      return
    end
    
    local beam = Material("laser")
    local targetPos = targ:GetPos()
    if(targ.IsPlayer() || targ.IsNPC()) then
      targetPos = targetPos + Vector(0, 0, 50)
    end
    
    render.SetMaterial(beam)
    render.DrawBeam(self:GetPos(), targetPos, 20, 0, 0, Color(color.x, color.y, color.z, 255))
    
  end
  
end